package com.li.controller;

import com.li.service.PyMethodService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.constraints.NotNull;
@Api(tags = "py数据处理")
@RestController
public class PyMethodServlet {
    @Autowired
    private PyMethodService pyMethodService;


    @GetMapping("/com/user/dataSolve")
    public ResponseEntity<String> dataSolve(@ApiParam("数据字段的json") @NotNull String data,  @NotNull @ApiParam("py方法名") String methodName){
        String rul = pyMethodService.executeML(data,methodName);
        return ResponseEntity.ok(rul);
    }
}
